Forum Replies Created
-
AuthorPosts
-
September 16, 2014 at 1:47 pm in reply to: Zoom levels not working with Satellite maps + Formidable #15182
The code is generating a map based on a Formidable form input, so it’s different each time. This is all generated using a Formidable View. Based on your request, I took a look at the code and discovered it was passing ‘null’ as zoom.
I just took a look at the ‘form_to_mappress’ code that I loaded in my theme’s functions.php file and saw that it wasn’t passing any sort of zoom or tilt level. I fixed it by adding values to the shortcode array and to the map output:
<?php /* SHORTCODE FOR MapPress + Formidable Pro connection */ add_shortcode('form_to_mappress', 'form_to_mappress'); function form_to_mappress($atts) { extract(shortcode_atts(array( 'width' => 425, 'height' => 350, 'title' => '', 'body' => '', 'address1' => '', 'address2' => '', 'directions' => 'none', 'zoom' => 20, 'tilt' => 45 ), $atts)); $mymap = new Mappress_Map(array('width' => $width, 'height' => $height)); $mypoi_1 = new Mappress_Poi(array('title'=>$title, 'body'=>$body, 'address'=> $address1)); $mypoi_1->geocode(); $mymap->pois = array($mypoi_1); if($address2 != ''){ $mypoi_2 = new Mappress_Poi(array('address' => $address2)); $mypoi_2->geocode(); $mymap->pois = $mypoi_2; } return $mymap->display(array('directions' => $directions, 'zoom' => $zoom, 'tilt' => $tilt)); } /* END SHORTCODE MapPress */Now it’s outputting exactly what I want, a close-up view of a specific property address input by the user. If there isn’t a 45 degree tilt view, it defaults to overhead, but the zoom level is exactly what I want.
Thanks for your assistance. Great support, as always!
September 15, 2014 at 5:22 pm in reply to: Zoom levels not working with Satellite maps + Formidable #15179But I can zoom in manually after the map loads? Shouldn’t I be able to set the zoom level before it loads? I can do it with a manually generated map.
FWIW, I’m trying to zoom in to view individual properties as close as possible.
3rd time’s a charm. By exporting the wp_mappress_maps table & importing into new db everything’s working. I’ll try your search and replace tool as well. Thanks. Great support, as always.
I also tried exporting the wp_mappress_maps table and importing it into the new site, still doesn’t work.
Shouldn’t I be able to copy the raw data from the obj field of the wp_mapppress_maps table from one site and paste it into the other?
A related question: is it possible to copy the contents (POIs) of a map from one site to another?
Also should mention the [3] (map id) is showing up on the new site in front of the “untitled” name.
I haven’t been able to figure out anything yet. I would just like to duplicate a map with a bunch of POIs on it and change the links from each POI to link to a page with the appropriate language.
I know this is an old thread, but I’m trying to do the same thing.
I don’t see a way to automate this without digging into the code, so I’m looking for a way to simply duplicate a map + all its POIs so I can translate manually. The WP plugin Duplicate Post doesn’t recognize custom post types.
Any ideas?
Okay, got the forms playing with the maps. Life is good.
Just as an aside, I added an additional Formidable plugin (found here: http://www.eish.it/formidable-geocoder/) to grab the lat/lon of each entry and store it in the database. It should help to speed things up and limit the number of hits on the Google geocode database.
I found a resolution. Apparently when I copied code from the Formidable website into Dreamweaver on the Mac it converted some characters. I’m thinking it was a double quote (“) or a single quote (‘), cause all the other code looked good.
I copied the code from Formidable again, pasted it into BBEdit (coding text editor on the Mac that allows you to control the text encoding), re-keyed any double or single quotes, then copied & pasted into my functions.php in Dreamweaver.
It works! Take a look here:
http://sf12cd74.a2hosting.com/~grote/contact-us/geographical-contact-information/headquarters/The company contact info on the right side of the page is pulled from a Formidable Pro database, and the MapPress map uses the address in the forms data.
Thanks so much for your help. LOVE the plugin, Chris!
Chris,
Thanks for the quick reply.
I actually tried adding the height var and all it does is give the div container a height, but still no map generated.
The problem isn’t related to Formidable. It looks like the PHP isn’t passing the vars properly. Here’s an example from the CDATA of a map using the shortcode:
var mapdata = {"mapid":null,"width":"220","height":null,"zoom":null,"center":{"lat":0,"lng":0},
Note the mapid, height, and zoom values are all null, and the lat/lon are both 0.A map created with your plugin manually for the same address:
var mapdata = {"mapid":"1","width":"220","height":"220","zoom":13,"center":{"lat":39.990817,"lng":-82.841705},
Sounds like there is a misplaced quote mark or comma somewhere. I’m on a Mac, sometimes characters (like “) don’t get translated correctly.
-
AuthorPosts
