pittss / goMap

jQuery plugin for google maps api v3
http://www.pittss.lv/jquery/gomap/
32 stars 10 forks source link

address & coords #6

Open aredqueen22 opened 10 years ago

aredqueen22 commented 10 years ago

Hello

Can i put address & coords together or seperated in the code?

Example : $(function() { $("#map").goMap({ address:'Québec, Quebec', latitude: 56.948813, longitude: 24.104004, zoom: 6 }); });

It's maybe not the best example.. but I have two fields to know the position of a place. The real address and coords. Thnks.

pittss commented 10 years ago

You can only put address or coords.

For what you need put address and coords? if you have coords it is the best for map. if you put address, first maps need to get coords from geocode and work with coords in map.

FlashJunior commented 10 years ago

here an example with a switch:

gomapOption = {
    zoom: 6
}

if( your condition ){
    gomapOption['address'] = 'Québec, Quebec';
}else{      
    gomapOption['latitude'] = 56.948813;
    gomapOption['longitude'] = 24.104004;
}

$("#map").goMap(gomapOption);

@pittss i think you can close this issue