diff --git a/app/models/concerns/node_shared.rb b/app/models/concerns/node_shared.rb index ad60560288..6ce7a44e7f 100644 --- a/app/models/concerns/node_shared.rb +++ b/app/models/concerns/node_shared.rb @@ -170,26 +170,17 @@ def self.upgrades_grid(body) end end + #Blank map loaded only , markers will be loaded using API call . def self.notes_map(body) body.gsub(/[^\>`](\)?\[map\:content\:(\S+)\:(\S+)\]/) do |_tagname| lat = Regexp.last_match(2) lon = Regexp.last_match(3) - nids = NodeTag.joins(:tag) - .where('name LIKE ?', 'lat:' + lat[0..lat.length - 2] + '%') - .collect(&:nid) - nids = nids || [] - items = Node.includes(:tag) - .references(:node, :term_data) - .where('node.nid IN (?) AND term_data.name LIKE ?', nids, 'lon:' + lon[0..lon.length - 2] + '%') - .limit(200) - .order('node.nid DESC') a = ActionController::Base.new() output = a.render_to_string(template: "map/_leaflet", layout: false, locals: { lat: lat, - lon: lon, - items: items + lon: lon } ) output diff --git a/app/views/map/_leaflet.html.erb b/app/views/map/_leaflet.html.erb index d8298c9a3e..0d0dfceb56 100644 --- a/app/views/map/_leaflet.html.erb +++ b/app/views/map/_leaflet.html.erb @@ -1,14 +1,25 @@ -<% unique_id = rand(100) %> - -
-<% if defined? people %>

Share your own location on your profile.

<% end %> - - <% items.each do |item| %> - L.marker([<%= item.lat %>, <%= item.lon %>]).addTo(map).bindPopup("<%= item.title %>"); - <% end %> -