archive-com.com » COM » S » SVENNERBERG.COM

Total: 274

Choose link from "Titles, links and description words view":

Or switch to "Titles and links view".
  • Google Maps API 3 - Markers
    in my blog Google Maps API 3 Markers This is an example of how to use markers in Google Maps API 3 Simple map Properties Markers This example is part of the article series Google Maps API v3 which is

    Original URL path: http://www.svennerberg.com/examples/google_maps_3/markers.html (2016-04-28)
    Open archived version from archive

  • Google Maps API 3 – Markers | In usability we trust
    far as I can see the ASP NET renders the HTML in the same way I don t want to bother you unnecessarily but I can post some examples if you re interested Many thanks Andy Reply Gabriel Svennerberg December 7 2009 at 7 28 pm Andy Clark Hi Andy and thanks I haven t seen any examples using ASP NET 3 5 but that shouldn t make any difference Make sure that you have dimensions set for the containing element of the map In my examples it s called div id map div Set its dimensions in your stylesheet like this map width 600px height 400px If that s not the problem post a link and I will try to take a quick look at it Reply David S December 13 2009 at 6 13 am Hi Nice article So far I haven t been able to find any API calls in v3 to duplicate the map clearOverlays function in v2 Are you aware of any way to remove markers Thanks David Reply Sandro Franchi December 27 2009 at 3 27 pm Hi Gabriel a question I m using MapIconmaker in one of my apps using API V2 x just because I need to specify marker colors based in some attribute I m willing to migrate to V3 but is MapIconMaker compatible with V3 or there is any other way perhaps native to specify the markers color and size Thanks in advance Sandro Franchi Reply Gabriel Svennerberg December 28 2009 at 10 20 am David There s no clearOverlays method in v3 so you have to manually keep track of your markers yourself One way of doing that is to keep them in an array To remove all the markers from the map you then loop through the array and remove them one by one See the Google Maps API v3 forum for an example on how to do this Sandro MapIconMaker is currently not available for v3 but I know that at least one person is thinking about porting it to v3 Unfortunately there s no native way of changing colors or size of the icons in v3 either Check out the thread about MapIconMaker in the Google Maps API v3 forum Reply Gilles Tanguay January 20 2010 at 7 25 pm Hi Is is possible to put miltiple and different markers on a google maps I want to be able to place different markers like the logo of the company on the map every company has a different logo and I want to be able to look at them easily Thanks Gilles Reply Gabriel Svennerberg January 20 2010 at 8 17 pm Gilles That s entirely possible You just need to create a new MarkerImage for each marker type and pass it as the value for the marker objects icon property or just pass an url to the appropriate image to the icon property Reply Enrico February 17 2010 at 5 08 pm Thanks very much Gabriel it s long time i was looking such a article so simple and clear Reply Paul April 7 2010 at 3 00 pm Hi Gabriel In my maps there is an option to display places of interest and then to choose which types of location coffee shop gas station etc to pinpoint on the map Is there any way of doing this in either V2 or V3 I couldn t see it when I looked through the docs but then there are a lot of docs to read I would find this very useful as our users who have holiday properties to rent could simply enter lat long of their location into our db and other users wanting to rent could see where these kinds of things are Hmmm simply Is there an API for searching by location centering the map on an address clicking on a button and getting an event with lat long of the map centre Reply Mike April 26 2010 at 11 12 pm Hi Great articles you have provided I am experimenting with adding a tooltip as described but unfortunately it doesn t appear Is there something wrong with my code Thanks Mike function initialize var latlng new google maps LatLng 15 6256915 73 7344704 var options zoom 15 center latlng mapTypeId google maps MapTypeId HYBRID var map new google maps Map document getElementById map options var marker new google maps Marker position new google maps LatLng 15 6191105 73 7351704 map map var marker new google maps Marker position new google maps LatLng 15 6188521 73 7347090 map map title My workplace clickable false icon http google maps icons googlecode com files factory png Reply Gabriel Svennerberg April 27 2010 at 6 31 am Mike After experimenting a bit I found that the property clickable needs to be set to true in order for the title to work Reply Basti May 11 2010 at 10 57 am Hey Gabriel great Tutorial very clear and simple but i ve a question what do you think is the best option do manage a large amount of markers in v3 Can I still use the markermanager or work with xml files And i need to have categories and different zoom levels on my map but i can t find a helpful tutorial do you have any tips for me Thanks a lot Basti Reply Gabriel Svennerberg May 11 2010 at 12 40 pm Basti Yes you can still work with MarkerManager and or XML files There s also a utility library called MarkerClusterer that you can use I don t know of any good tutorial on this for v3 but I ve just finished a chapter on how to do this using the MarkerManager for my upcoming book So if you can wait until August you ll find a tutorial right there Other than that you can check out the examples in the documentation for MarkerManager Reply Brendan May 27 2010 at 3 55 pm Great explanation I have a mini site where you can in put a start point and an end point then Google draws the journey on the map However the default markers are just A and B I need control over these labels Any help would be much appreciated Reply Zwirko May 31 2010 at 11 48 am Is it relatively easy to get a title tooltip to display when you load lots of markers from an xml file I m struggling with this Reply Dominic June 3 2010 at 8 03 am Is it possible to have the tooltips of all markers staying on screen all the time without the need to move mouse over them Reply Jim Buckley BArrett October 13 2011 at 4 25 pm I found this link today http google maps utility library v3 googlecode com svn trunk maplabel examples maplabel html Reply Gabriel Svennerberg June 3 2010 at 11 46 am Dominic No it s not What it does is to attach a title attribute to the html element holding the marker If you want to have a persistent label you need to use some kind of third party solution Check out the official utility libraries currently available for v3 Maybe you could use the InfoBox library to do this Reply mirekh June 22 2010 at 1 57 pm Hi please give me an advice in V3 I would like to specify a zoom level which the marker start to be displayed with There was no problem to do that in version 2 I did that with mm new GMarkerManager map borderPadding 1 mm addMarker marker 2 17 How do that in V3 Reply Gabriel Svennerberg June 22 2010 at 4 24 pm Mirekh There s a v3 compatible version of MarkerManager that you can use to do the exact same thing Check out MarkerManager at the Google Code repository Reply selvaganesan s June 25 2010 at 7 48 am Hi How can i remove the markers from map in api 3 Because i have marker overloading problems please help Reply Dan June 29 2010 at 1 33 am selvaganesan s i ve been just dealing with this problem you have to store your marks in some variable Array is ideal for bunch of marks When you wanna clear them from the map and release from memory call marker setMap null for each of them var map new google maps Map element options var marker function addMarker title lat lng var m new google maps Marker position new google maps LatLng lat lng map map title title marker push m function clearMarks while m marker pop m setMap null Reply Wayne Sallee June 29 2010 at 7 14 pm 20 April 27th 2010 at 6 31 by Gabriel Svennerberg Author comment Mike After experimenting a bit I found that the property clickable needs to be set to true in order for the title to work So shouldn t it be changed to clickable in the instructions Wayne Sallee Wayne WayneSallee com Reply blindfish July 9 2010 at 2 08 pm Thanks This is a really useful article I ve now managed to read data from an XML file and display markers based on categories with options to show and hide each category I m currently not using MarkerManager to manage my markers it didn t seem to work happily with my code but instead have added a listener to each marker to determine whether it is displayed at any given zoom level That doesn t seem entirely efficient to me as I m assuming that markers that are not visible in the map area at a given zoom level i e they re off screen are still using resources I guess I ll have to persevere with MarkerManager in order to address this assuming the map renderer doesn t handle it I have one question that I haven t seen addressed anywhere yet Roughly how many markers can the system handle display at any one time From the MarkerManager documentation it sounds like it might be up to 200 Are there any recommended limits we should stick to I m still at the research stage and don t know how much data I m going to be working with so just want some idea of how lazy I can be with optimisation Reply Billy September 7 2010 at 1 53 am Hi Gabriel I wantt o thank you for this I have been trying to put together the code for a google map that I will be putiing on a site I am working on I dont know if you can assit hoefully you might what I am looking to do it place a marker and shadow on map this I can do but having trouble trying to workout to position the shadow to sit evenly behid the main maker I have looked at many tuts but cab seem to get this any help be grateful for a newbie at map making Reply James September 22 2010 at 11 25 pm Thanks Gabriel so easy to understand And thank you also for your comment on the fitBounds method worked a charm Reply hanifa maricar October 8 2010 at 5 43 pm Gabriel I ve just order your book from amazon I just want to ask you if there is any merit in learning KML I am using not asp net and putting up with messy Javascript Just your opinion Respectfully Hanifa Reply Gabriel Svennerberg October 8 2010 at 10 52 pm Hanifa Personally I haven t been using KML a lot but I suppose it has its benefits especially if you plan on developing for Google Earth as well Its just an XML format so it s really no big deal to learn Reply shitao January 8 2011 at 10 35 am hello every now I want make a Mark with description words besides just like labelMarker in API2 how to program thanks from china Reply shitao January 8 2011 at 10 38 am hello every expert now I want make a Mark with description words besides just like labelMarker in API2 how to program attention not the property title thanks from china Reply genti January 10 2011 at 6 00 pm Hi i need would to display cached mysql markers on a map depending on a range in meters that users can choose Any idea about resolve this Reply Gabriel Svennerberg Post author January 10 2011 at 11 20 pm shitao Check out the utility libraries for v3 BothInfoBox and MarkerWithLabel might be of interest for you google maps utility library v3 Reply David Underhill January 16 2011 at 10 34 am Thanks Gabriel this is just what I was looking for but I d overlooked it in the docs oops Reply Ygam Retuta March 1 2011 at 9 53 am Hi I have just started reading your book but so far have not found a solution in what I m trying to do I am trying to duplicate an icon with the following code http jsbin com ijujo3 edit however I can t get the icon to display using an MarkerImage object What I want to do is to duplicate the marker icon and scale it then assign it to the babyMarker icon any ideas Reply Ygam Retuta March 2 2011 at 3 31 am I have already solve the problem described above regarding duplicating markers Here is the solution http www ygamretuta com 2011 03 duplicating and scaling an existing marker icon in google maps v3 Reply Gabriel Svennerberg Post author March 2 2011 at 1 12 pm Nice job Ygam I m sorry I didn t answered your question in time One note on your solution The getIcon method of the Marker object is documented Look here in the API documentation Reply bondeth April 4 2011 at 11 38 am I want to be able search street number and street name in google map api 3 So anyone have any idea to do it or some tutorial Thank in advance Reply Gabriel Svennerberg Post author April 4 2011 at 12 21 pm bondeth Check out the part about Geocoding in the Google Maps API documentation Reply SM April 6 2011 at 1 54 pm NOBODY at the entire friggin internet has talked about how to create multiple markers and deleting them upon choice If I have three markers and I want to remove for instance only the first one with say rightclick how the h k do you do that Me and my friend have been sitting on this problem in v3 for a week now without finding anything Google sucks when it comes to API s Come on this problem can t be too hard to foresee Christ gonna do harakiri soon Reply SM April 7 2011 at 10 42 am I AM AN IDIOT Here is answer to this meticular problem which wasn t a problem at all Gooosh Every marker must have it s own reference This reference must be a unique name Thus can you listen for this special reference when it fires the desired event function init var m1 Latlng new google maps LatLng 25 363882 131 044922 var m2 Latlng new google maps LatLng 22 363882 131 044922 var myOptions zoom 4 center m1 Latlng mapTypeId google maps MapTypeId ROADMAP var map new google maps Map document getElementById map canvas myOptions var marker1 new google maps Marker position m1 Latlng draggable true title Marker 1 var marker2 new google maps Marker position m2 Latlng draggable true title Marker 2 google maps event addListener marker1 rightclick function event marker1 setMap null google maps event addListener marker2 rightclick function event marker2 setMap null To add the marker to the map call setMap marker1 setMap map marker2 setMap map Reply Edward April 7 2011 at 6 48 pm Hi I can t get the custom marker to display in Chapter 6 What am I doing wrong Reply Gabriel Svennerberg Post author April 8 2011 at 12 02 am Edward Hard to say Can you provide a link to your code You can also download all the examples in the book from the book page and compare that to what you ve written yourself Reply oven lu April 8 2011 at 7 45 am Hi I am a C programmer here is my problem if I Click the marker I want the map change center but I want use the LatLng witch is find by marker to set the map center now I can t find the LatLng Reply Gabriel Svennerberg Post author April 8 2011 at 8 00 am lu Here s one way of doing it google maps event addListener marker click function e var latLng e latLng Reply Edward April 8 2011 at 9 37 am Hi Thanks for the reply heres my JS code no recycle marker shadow function window onload function var options zoom 3 center new google maps LatLng 37 09 95 71 mapTypeId google maps MapTypeId ROADMAP var map new google maps Map document getElementById map options var recycle new google maps MarkerImage img recycle png var shadow new google maps MarkerImage img shadow png var marker new google maps Marker position new google maps LatLng 40 756054 73 986951 map map icon recycle shadow shadow Is it something obvious Thanks again Reply Gabriel Svennerberg Post author April 10 2011 at 10 08 am Edward Your code looks good except for the trailing comma in the options object It will make IE choke But I don t think that your problem Check the paths to the images recycle png and shadow png I suspect that these might be wrong Reply Edward Kemp April 14 2011 at 11 15 am Hi Thanks for your help Fixed this now Another question sorry when creating the random markers for example 9 1 when the map is set to zoom 3 the centre moves to the middle of

    Original URL path: http://www.svennerberg.com/2009/07/google-maps-api-3-markers/?replytocom=601 (2016-04-28)
    Open archived version from archive



  •