Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I have a map google v3. What code to write, to add markers with pop-up windows, the coordinates of which are stored in the database mssql server 2008 r2? Markers a lot about 1500. Can cycle to read from the database and add markers to the map?

function initMap(contentFlag){
  var latlng = new google.maps.LatLng(56.83, 15.16);          
  var options = {  
    zoom: 7,
    center: latlng,
    mapTypeId: google.maps.MapTypeId.ROADMAP
  };          
  microMap = new google.maps.Map(document.getElementById('microMap'), options);  

  var infowindow = new google.maps.InfoWindow;                
  var marker = new google.maps.Marker({
    position: new google.maps.LatLng(56.8848, 14.7730), 
    map: microMap,
    title: 'Маркер'
  });

  google.maps.event.addListener(marker, 'click', function() {
    if(contentFlag=="simple")
        infowindow.setContent(simple);
    else 
        infowindow.setContent(advanced);
    infowindow.open(microMap, marker);
    if(contentFlag=="advanced")
        macroMap = new google.maps.Map(document.getElementById('macroMap'),{
            zoom: 14,
            center: latlng,
            mapTypeControl: false,
            navigationControlOptions: { 
                style: google.maps.NavigationControlStyle.SMALL
            },
            mapTypeId: google.maps.MapTypeId.HYBRID
        });
  });
share|improve this question
    
Can explain your question a little clearer - you want all the markers or just the returned markers in the map window (bounds)? –  Mapperz Jul 3 '13 at 13:35
add comment

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.