Google Maps

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
calder
User
Posts: 3

Google Maps

Post by calder »

I'm experimenting with PHPMaker, I can get most of the things working ok, but Google Maps has me stumped.

My db is simple - basically latitude, longitude, name and address, with QR codes thrown in for good measure. So, based on the demo file, I added this line:

{"id":"GoogleMaps","name":"Google Maps","width":null,"width_field":null,"height":null,"height_field":null,"latitude":null,"latitude_field":null,"longitude":null,"longitude_field":null,"address":null,
"address_field":"address","type":"ROADMAP","type_field":null,"zoom":8,"zoom_field":null,"title":null,"title_field":null,"icon":null,"icon_field":null,"
description":null,"description_field":null,"apikey":null,"use_single_map":true,"single_map_width":600,"single_map_height":300,
"show_map_on_top":true,"show_all_markers":true}

to the custom view tag of the 'address' field, and set the "address_field" to "address". I didn't bother with an API key, these don't seem to be required with v3 of GMaps.

As well I added ewgooglemaps.js to the phpjs folder. I found nothing else that I could see in the demo file that I should amend.

That produced what you can see at the sandbox above. It's not quite what I want.

I tried to add the latitude and longitude fields to the appropriate places in the line above, and either with or without the address field, the maps would not render to the lat/longs. By the looks of it, I can't use 2 fields (lat/long) to position the map markers (does this mean some sort of concatenation is required?). The address plot is not accurate enough.

Also note that the actual address is hidden, only the map shows. There has to be a workaround for this, I think.

I changed just a few things in the GM line. To see the result, Google for Auscem and add /php11 to the end of the URL. It's still a bit messy, but the elements are coming into place.

The line became:
{"id":"GoogleMaps","name":"Google Maps","width":null,"width_field":null,"height":null,"height_field":null,"latitude":null,"latitude_field":"latitude","longitude":null,"longitude_field":"longitude","address":null,"address_field":null,"type":"ROADMAP","type_field":null,"zoom":8,"zoom_field":null,"title":null,"title_field":"null","icon":null,"icon_field":null,"description":null,"description_field":"address","apikey":null,"use_single_map":true,"single_map_width":null,"single_map_height":null,"show_map_on_top":true,"show_all_markers":true}

A few things (map size, zoom) got adjusted in the online version, just to experiment with different values.

By the look of it, I am plotting lats and longs - the Google js file seems to allow this, and checking a number of my sites seems to confirm this.

I'd like to have mouseover (not click) on the markers. Mouseover does work, but erratically. The first time I mouseover a marker, nothing happens. But if I click, then dismiss whatever I have set, then the next mouseover will work. But only once, it seems.

Paul


Post Reply