Approaching a map based selection - html

I have a map of several counties I need to turn into a county select menu (i.e clicking Leicestershire will select Leicestershire.
I am using a php built system that this map will need to return the appropriate value to. I am thinking this will be a get in the url, checked for valid values in the backend.
How would you approach this? A html co-ordinate map? Some sort of Javascript? Flash?
I am aware all those solutions have one drawback or another. Does anyone know a better way of doing this? Or an existing opensource project?

Just an idea, if I read your problem correctly: I would personally use the Google Maps API for this. Plot each county onto your custom Google Map, then when you click each marker an info window could appear with "Select this County". Click the link and pass a value through the URL to your PHP script.

Used a html map system. Dreamweaver made it easy (first time I've used the design screen seriously)

Related

How to extract data from webpage

I access a webpage (eg "http://signal.eu.org/osm/#locs=40.853293,14.244461;41.312371,16.288605"), which shows a map control with details of a rail route. On that webpage there exists the map as a control. If I examine the map control using standard Edge functionality, I can see a series of coordinates. I would like to extract these coordinates for use in my VB.Net program. I can handle the desktop part, but the Webpage thing is all new to me. I have tried using a WebClient and downloading as a string, or using a WebBrowser and examining that object, but all I see is the main web page details and not the map control.
Any help would be really appreciated as I have just spent a few hours with google and I feel like I'm not really asking the right question.
If I understand correctly you want the direction of the map. So you want the step by step direction of how to go from "Via Matteo Renato Imbriani, Quartieri Spagnoli, Municipalità 2, Napels, Napoli, Campania, 80136, Italië" to "strada locale, Barletta, Barletta-Andria-Trani, Apulië, 76121, Italië"?
If this is the case, google provides an API exactly for that (Google for "Google direction API").

Google Maps URL with pushpin and satellite basemap

Background Information
I can form a simple valid Google Maps URL that has a pushpin on a coordinate like so using the query parameter:
https://www.google.com/maps/search/?api=1&query=47.5951518,-122.3316393
Direct link
Similarly, I can form a URL with a satellite image of the same location using the center and basemap parameters:
https://www.google.com/maps/#?api=1&map_action=map&center=47.5951518,-122.3316393&zoom=17&basemap=satellite
Direct link
Desired End Result
What I'd like to have is a satellite image like in the second URL with a pushpin. The result of this can be seen by using the first URL and pressing the 'Satellite' button on the bottom left of the map. From what I can tell, the basemap and query parameters may not be used together like below, but I'd love to be proven wrong.
https://www.google.com/maps/search/?api=1&query=47.5951518,-122.3316393&basemap=satellite
Desired end result:
Direct link
I need to be able to construct the URL with a dynamic set of coordinates. I haven't found a way to manipulate the parameters in order to accomplish this.
Note: the final URL I included is an "unpacked" URL generated by Google Maps and not constructed by hand. I haven't found a way to manipulate it the way I want, and even if I could, I'm sure it's not the correct way to solve this problem.
You are right in that this can't be done with the new Google Maps APIs. The "Search" URL scheme allows pinning but no satellite view, whilst the "Display a map" scheme allows satellite views but no pinning.
However, it is possible get both pinning and satellite views by using this old, no-official-documentation, scheme:
http://maps.google.com/maps?t=k&q=loc:47.5951518+-122.3316393
The t parameter used to work with a number of different values but only two seem to currently still work:
t=m - Normal map view
t=k - Satellite view
Note that unofficial documentation for the other parameters can be found here. Some of these may also still work.
For anyone still looking for a solution in 2022, you can use the following undocumented URL scheme:
https://www.google.com/maps/place/{lat},{lng}/#{lat},{lng}/data=!3m1!1e3
This is the best solution I could find that mimic the plan-limited query URL scheme:
https://www.google.com/maps/search/?api=1&query={lat},{lon}

Placing existing Google Map V3 into a form to change address

I'm building an application where user-submitted posts are placed via their location as markers on a Google Map. The users are currently able to view the markers/posts on a map in relation to their current location.
What I'm aiming to do is allow the user to change the location of the map so that users can see the markers/posts in relation to another address, specifically via a form that allows them to enter an address and change the location of the map.
I found a YouTube video illustrating a pretty close approximation of what I'm aiming to do, but it unfortunately provides no code or instructions (http://www.youtube.com/watch?v=4uyIawlsvzU).
Is there a way to efficiently wrap an existing Google Map and the existing markers into a form such as this? I've searched for a solution but can't seem to find the proper way to achieve this. Many thanks for any feedback.
You need to search for LatLng by user specified address and to display it. I see not problems at all :)
Study Google Geocoding API for this (seems best solution for your case) and this example

How do I remove 'Earth' button from Google Maps?

I'm using the Google Maps generator to create a few maps for a client. The maps embeded on the site are a bit small (255x176), so map real state is crucial. I've already removed the balloon, but can't find a way to remove the "Earth" view button from it (all newly generated maps come with it now, 4 views in total).
The annoying part is that the "Earth" view requires a Google Earth plugin to be used anyway, something the client could live without - me too.
Any advices there? Feedback will be greatly appreciated!
Cheers,
Wallace
You may customize the map controls using the MAPS API.
Visit http://code.google.com/apis/maps/documentation/javascript/controls.html#DefaultUI
Look for MapTypeControlOptions and pass appropriate map type you want to show.
Refer http://code.google.com/apis/maps/documentation/javascript/reference.html#MapTypeControlOptions
http://code.google.com/apis/maps/documentation/javascript/reference.html#MapTypeId
If using the default UI, you would get only the map types in G_DEFAULT_MAP_TYPES, which does not include the Earth map type (G_SATELLITE_3D_MAP).
This means your generator is adding this map type explicitly. So you should be able to simply look for G_SATELLITE_3D_MAP in the javascript you get from the generator, and remove references to it.
If you are still having troubles, can you provide a link to the map generator you are using?

Do i need use google maps api only to embed litle map with route calculator/display for only one destination?

Well i want to upgrade contact page with dynamic map showing location and give oportunity to calculate route for comapny headquatters. Id it necessery for such simple task use Google api? i mean here generating akey etc? Fo i have any other alternatives to google maps?
There's really no reason to mess with the API at all unless you need to customize the appearance or behavior of gmaps. Why not just use an iframe with a url of:
http://maps.google.com/?q=[you-url-encoded-address-here]
or better yet, set up a textbox and a 'get directions' button to redirect that frame to:
http://maps.google.com/maps?saddr=[their-address]&daddr=[your-address]
edit: this works well in modal dialog if you don't want the google logo sticking out like a sore thumb in your pageflow
You could probably embed directly with a specific URL that will configure it to have the destination you want.
By the way, well written answers are much more likely to receive useful responses here.
You could consider http://www.openlayers.org/ as an alternative to google maps.
In fact open layers can be used to add a Google map, or an OpenStreetMap map or a Bing map, etc.