1

I am using some code in my view as,

<body onload="initialize()">
    <div id="map_canvas" class="span8" style="height:400px"></div>
</body>

<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBl7fhDpSzGAqljlW7OCJZBsq6oDlGeckw&sensor=false"></script>
<script src="<?php echo $BASE?>scripts/analytics/standard_prospects_physicallocations.js" type="text/javascript"></script>

I am getting city & state name from the server side controller but I want to show pointers to those city. How can it be done? If you are having any reference for that then suggest me.

Mayukh Roy
  • 1,815
  • 3
  • 19
  • 31
Rahul_RJ
  • 2,795
  • 3
  • 14
  • 10
  • By that city and state name you can find it's latitude and longitude and you can then you can use latitude and longitude to show pointers on the map. – Ravinder Singh Mar 06 '13 at 12:01

2 Answers2

1

I dont think we can mark state/city by their names, unless we have the related Lat/Longs.

If you have the set of lat/long for the border of a city or state, this can be marked as polygons.

I found, Google Geo Charts can help you marking areas.

Again, you can check this a s quick reference.

Community
  • 1
  • 1
Mayukh Roy
  • 1,815
  • 3
  • 19
  • 31
0

Geocoding would be the way to find out the lat/long from a city/state combo.

On the other hand. It would be a lot easier (cheaper on the round trip times and less requests (which are limited)) to retrieve the lat/longs from the same source as the city name/states.

Once you have the lat/longs, it just becomes a case of plotting markers as standard.

Rafe
  • 793
  • 6
  • 15