Jump to content
php.lv forumi

Google Maps API precīzs kartes izmērs


senters

Recommended Posts

Izmantoju Google Maps API v3 eventu attēlošanai LV kartē.

 

Vajag dabūt precīzu LV kartes izmēru uz 1004px platuma, lai ietilptu precīzi pilnā lapas platumā visa teritorija.

 

Diemžēl zoom parametrs 7 ir par mazu (http://screencast.com/t/EpWvcUrikRlZ), 8 - par lielu (http://screencast.com/t/M39AduFjrga)

 

JS konfigs:

 

 

// Google Maps API v.3
var map;
function initialize() {
   var myOptions = {
       zoom: 8,
       center: new google.maps.LatLng(56.879635,24.603189), // Latvija
       mapTypeId: google.maps.MapTypeId.ROADMAP
   };
   map = new google.maps.Map(document.getElementById('cities-map'),
       myOptions);
}
google.maps.event.addDomListener(window, 'load', initialize);

 

Cik skatos te (https://developers.g...script/tutorial) nekur nav teikts, kā varētu pielāgot karti lai tā precīzi ietilptu konkrētos izmēros (px).

Edited by senters
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...