I am using Bing Maps. I have 25 latitude and longitude values, i am showing list of only 5 values(Lat and Long)with previous and next buttons on left side and maps on right side(showing pushpins on hard-coded zoom level). But i need to show only 5 pushpins which is there in the list on left side.
If i click on next button i can able to load next 5 lat and long values(on left side), but i need to change the map(on right side) to show only pushpins from 6 to 10.
If i zoom out, i should be able to see all Pushpins. Is this possible in bing maps?
And also how can i show tooltip on mouse over of pushpins.
Yes. This can be easily done. It's just a mater of storing all the locations in an array and keeping track of the index of the pages. If the page changes grab the data for that range, clear the map and add the new locations to the map, maybe center over as well for a nicer experience. You can add some logic that uses the view change end event to know when the zoom levels change and show all locations when the zoom level is such that it is zoomed out enough. Here is some documentation on some of the things you will need:
http://msdn.microsoft.com/en-us/library/gg427604.aspx
http://msdn.microsoft.com/en-us/library/gg508988.aspx
http://msdn.microsoft.com/en-us/library/gg427611.aspx
Related
Currently, I have about 20 markers being shown in the same coordinate, as the data given. I have made popups for all of them containing their data. However, when I click them, it shows only the details of the top marker.
Is there a way to have the popup with a side arrow which allows the next data point to show up?
My current implementation is, when I open the html via browser it zooms to North America map with 4 markers. On click of the markers, the maps is zoomed to that location with few more markers added. Now I would like to add a back button so when the button is clicked it should take me to the initial maps page with 4 markers.
Your help is much appreciated.
Thanks,
Chitra
The features of Google Maps API that you will need to use are bounds. For a rough understanding, imagine providing a top left corner point and a bottom right corner point and just telling the viewport to zoom and track to fit them in. There is a good answer here: Google Map API v3 — set bounds and center
As for how you implement the actual button to trigger the feature, that is a separate question and there are many potential solutions. Again, it has already been discussed here: Put a button on top of a google map
As I am getting the same latitude and longitude from database for different markers, the markers are getting pin on each other, now I want to perform click event on makers alternatively, but only the top marker pin is clicked, how can I click the back one .
OverlappingMarkerSpiderfier is the solution: https://github.com/jawj/OverlappingMarkerSpiderfier
Ever noticed how, in Google Earth, marker pins that overlap each
other spring apart gracefully when you click them, so you can pick the
one you meant?
And ever noticed how, when using the Google Maps API, the same thing
doesn’t happen?
This code makes Google Maps API version 3 map markers behave in that
Google Earth way (minus the animation). Small numbers of markers (yes,
up to 8) spiderfy into a circle. Larger numbers fan out into a more
space-efficient spiral.
Demo page is here: http://jawj.github.io/OverlappingMarkerSpiderfier/demo.html
I'm working on creating custom map tiles (.PNG) which I can show with ImageMapType from the Google Maps API range. In general, the tiles are shown fine and I get the tiles I want with no real problems.
However, an issue which I can not seem to solve at all, is a weird upwards push of the tiles at a single specific zoom level (9). My original tiles do have many gaps for the ocean in them, so I generate blank tiles to fill in the gaps by surrounding my original map tiles with transparent points in a grid.
For testing purposes, and to show you the exact issue, i've made the grid points visible, and quickly taken a snapshot of the upwards push during the transition phase. The top left of the dark region is where the corner was for the previous layer, and after zooming in, the top marked section is where the corner moved it.
After I go past this layer, into layer 10, the corner goes back down a level, to where it would have been if layer 9 wasnt so buggy.
Hope I've provided enough information and I'll be grateful of any advice.
For zoom problem keep one transparent div with z-index and then set map zoom on 9 also hide its zoom control from map By this no one can zoom your map and for tile problem I need its demo page for more information but with this answer i attached a url for your help with full tutorial just check it : https://developers.google.com/maps/documentation/javascript/v2/overlays#Custom_Map_Types
Gud luck
I have a map application that can be seen here:
http://chrismcaleenan.com/map/?page_id=25
Each of the Malaysian states in the application will have an InfoWindow that displays additional information. You can see an example of this by mousing over 'Kedah' either in the main data table on the right or on the state itself in the map.
The problem, as you can see, is that the map pans in order to position the InfoWindow. Is there a way to fix the map position and set the InfoWindow size or position so that it is fully displayed without panning? In the Kedah example, one could have the InfoWindow positioned directly to the right and/or use a shorter tail.
One option would be to create a custom graphic for each state, but I'd rather avoid this as I will be running into the same issue with add'l data (e.g. click Kedah to zoom - will have InfoWindows on all data points on zoom).
If you're playing around double-clicking the water will zoom back out and reset map.
Thanks!
Yes, and sometimes the pan pulls the mouse outside of the state, which causes the InfoWindow to disappear. I know that's not what you want. The Google Maps demo catalog includes a sample that I think will give you what you want for your map. It's named SmartInfoWindow. Take a look, click on some of the markers, check out how the SmartInfoWindow behaves, and see if that might help you achieve what you want. It's not perfect, but it keeps the pan at the absolute minimum.