How can I position items within Google Map using longitut and latitude


On my Asp.Net C # page I show a google map and in a list I have several addresses (longitude, latitude) and I want my map to appear with a reference to each of them ... How can I do it? / p>

 foreach (var item in lista)
     double? latitud =  item.config.Position.Latitude;
     double? longitud = item.config.Position.Longitude;
asked by Efrain Mejias C 02.09.2016 в 17:26

1 answer


You will not be able to do this from .net code

You'll have to expose a webmethod on the page and send these positions as json to the client, then when you render the page you invoke using $.ajax of jquery to the webmethod, you get the json with the positions and assign them creating the Markers.

Google Map with JSON

in the article explains what I mention.

From the javascript function CreateMarker() the $ .ajax is used to invoke the webmethod who returns the json the geolocation that must show on the map

answered by 02.09.2016 / 18:45