google-maps-api-3

change google maps custom icon with zoom

China☆狼群 提交于 2019-12-25 07:51:55
问题 I am trying to change my google map markers so that when the zoom is < 5 they change from their custom markers to a star image. This is what I have so far (not working) //zoom icons to stars at continent level google.maps.event.addListener(busMap, 'zoom_changed', function() { var markerIconStar = google.maps.MarkerImage("icons/star.png"); var currentZoom = busMap.getZoom(); if (currentZoom < 5){ markerSanFran.setIcon(markerIconStar); markerLA.setIcon(markerIconStar); markerHollywood.setIcon

Change icon on Google maps

谁说胖子不能爱 提交于 2019-12-25 07:33:23
问题 I have been trying several options but unfortunately I'm unable to have different icons for different locations. I also tried to find out why the weather layer optional field is blank as in other applications but it did work. I would appreciate any help. <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true&language=en&libraries=weather"></script> <style type="text/css"> #apDiv1 { position: absolute; right: 240px; top: 5px; width: 160px; height: 39px; z-index: 1;

google maps api v3 display different markers

Deadly 提交于 2019-12-25 07:24:12
问题 I'm trying to display different markers depending the condition every time. For example : If temp > 1 display "ilios" If humidity > 97% display "omixli" I am trying to create inside the createmarker() function the var marker1( the code in comments ) but i cannot find the way. Does anybody have an idea how i'm gonna do it in this or in a different way? Any suggestion , examples , comments would be appreciated! var infowindow; var map; function initialize() { var myLatlng = new google.maps

Google maps API showing blank map when given LatLng cords from HTML5 Geolocation

偶尔善良 提交于 2019-12-25 07:20:27
问题 I'm trying to use HTML5's geolocation features. I have a function to get the coordinates and then another to use those coordinates in a call to the Google Maps API. If I manually specify the Latitude and Longitude it works great, but for some reason it doesn't work this way, I just get an empty map, controls are there, but no actual map. I believe the code is correct, but maybe I overlooked something. Here's the code: var x = document.getElementById("msg"); function getLocation() { if

Google Maps API V3 - Label Fusion Tables polygons by employing InfoBox

笑着哭i 提交于 2019-12-25 07:04:09
问题 I'm trying inside Google Maps API V3 to Label Fusion Tables polygons by employing InfoBox, for this I use example from http://www.geocodezip.com/geoxml3_test/v3_FusionTables_zipcode_map_whiteBg.html, but code (as shown below) do not display labels: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Label Fusion Tables polygons by employing InfoBox</title> <style> #map_canvas { width: 610px; height: 400px; } .style1 {font-size: 14px} </style> <!--Load the AJAX

How to set dynamic pixel offsets for infoboxes?

六月ゝ 毕业季﹏ 提交于 2019-12-25 06:59:33
问题 I have a map with multiple markers of basically 2 types. One is a larger, wide marker, and the other is a lot smaller, square marker. Both types need to have an infobox that appears when clicked. Due to the different shapes and sizes of the markers, I'd very much like the infobox windows to be anchored at different positions based on which marker is being clicked. Of course I found the pixelOffset property for the infobox options, but I seem unable to set this dynamically based on the marker

Google map icons in different colours java script, my code is not working

拟墨画扇 提交于 2019-12-25 06:48:05
问题 Can anyone tell me the Google map generated Java Script my code is not working. This java script dynamically located items for different dynamically category levels display the Google map Icons in different colours. I am using MCV 5 and C#. I have attached my Java Script code. function initialize() { var myLatLng = new google.maps.LatLng(-34.397, 150.644); var options = { zoom: 6, center: new google.maps.LatLng(-34.397, 150.644), mapTypeId: google.maps.MapTypeId.ROADMAP, mapTypeControl: true,

Google Maps: Can't add marker

流过昼夜 提交于 2019-12-25 06:39:05
问题 Can't get a marker added, probably something very simple but I'm new to this. Thanks. <script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?&sensor=true"></script> <script type="text/javascript"> function addMarker() { var marker = new google.maps.Marker({ position: new google.maps.LatLng(-34.397, 150.644), title:"Hello World!" }); } function initialize() { var mapOptions = { center: new google.maps.LatLng(-34.397, 150.644), zoom: 8, mapTypeId: google.maps.MapTypeId

Google Maps Drawing Library vs Standard Drawing Techniques

情到浓时终转凉″ 提交于 2019-12-25 06:37:00
问题 I am wondering what are the advantages and disadvantages of using Drawing Library versus standard Google Maps API techniques to create shapes like new google.maps.Polygon , new google.maps.Circle , new google.maps.Rectangle , etc. If the goal of the application is to collect spatial data (i.e., coordinates) in a database, will that affect which method to use? This is more of a discussion type of question so I look forward to your thoughts. 回答1: By Using Event Listeners you can collect the

How do I offset a Google Map Marker?

陌路散爱 提交于 2019-12-25 06:33:08
问题 I've read a few posts on here regarding the same thing. I have the code used, but I'm not sure if I'm using it correctly. The one thing they didn't really say was how would that code be used with the other javascript for Google Maps that controls the parameters, styling, etc. Here's the snippet from the other thread: function offsetCenter(latlng, offsetx, offsety) { // latlng is the apparent centre-point // offsetx is the distance you want that point to move to the right, in pixels // offsety